x86: small fixes to pcpu platform op handling
authorJan Beulich <jbeulich@suse.com>
Thu, 24 Nov 2011 16:56:26 +0000 (17:56 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 24 Nov 2011 16:56:26 +0000 (17:56 +0100)
commit0244dc67686f8b683bc4998b90009c4747ba7955
tree00588ff13eab9d597e6a46b53e6eb565a4ba0897
parent41f1a2fac48465b0b3863f1f9eec0a1a72101e46
x86: small fixes to pcpu platform op handling

XENPF_get_cpuinfo should init the flags output field rather than only
modify it.

XENPF_cpu_online must check for the input CPU number to be in range.

XENPF_cpu_offline must also do that, and should also reject attempts to
offline CPU 0 (this fails in cpu_down() too, but preventing this here
appears more correct given that the code here calls
continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down()
would ever allow bringing down CPU 0 (and a distinct error code is
easier to deal with when debugging issues).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/platform_hypercall.c